#include<stdio.h>
int main()
{
    int a,b,c,m,n,i,g=1,sum,s,e;
    scanf("%d",&i);
    while(g<=i)
    {
        if(a>0&&b>0)
        {
            scanf("%d %d",&m,&n);
            s=m+n;
            if(m<a)
            {
                e=a;
                a=m;
                m=e;
            }
            if(n>b)
            {
                e=b;
                b=n;
                n=e;
            }
            if(s>sum)
            {
                e=sum;
                sum=s;
                s=e;
            }
            g++;
            continue;
        }
        scanf("%d %d",&a,&b);
        sum=a+b;
        g++;
    }
    printf("%d %d %d",a,b,sum);
    return 0;
}
